﻿@model Zor_Web.Models.Browse.V_AHouseholdTax
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>一户式纳税情况表</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
</head>
<body>
    <div class="layui-tab layui-tab-brief main-tab-container">
        <div class="col-sm-12 ct-padding">
            <div class="col-sm-9 ct-padding">
                <button id="btnExport" class="layui-btn layui-btn-springgreen layui-btn-small"><span class="glyphicon glyphicon-share"></span> 导出 </button>
            </div>
            <div class="col-sm-3 ct-padding">
                @using (Html.BeginForm("AHouseholdTax", "Browse", new RouteValueDictionary { { "where", "" } }, FormMethod.Post))
                {                                                         
                 <input id="input" name="where" value="@Request.QueryString["where"]" placeholder="请输入身份证号" />
                 <input type="submit" value="查询" class="layui-btn layui-btn-normal layui-btn-small" />
                }
            </div>        
        </div>

        <div class="col-sm-12  layui-tab-content">
            <div class="mail-box" style="overflow-x:scroll;white-space:nowrap;">
                <table class="layui-table" lay-skin="line">
                    <thead>
                        <tr>
                            <th hidden></th>
                            <th>受理单号</th>
                            <th>完税证号</th>
                            <th>发票号</th>
                            <th>房屋属性</th>
                            <th>房屋租金(元)</th>
                            <th>房屋面积</th>
                            <th>征收起日</th>
                            <th>征收止日</th>
                            <th>纳税时间</th>
                            <th>纳税额(元)</th>
                            <th>状态</th>
                            <th>房屋地址</th>
                        </tr>
                    </thead>
                    <tbody id="accordion">
                        @foreach (var item in Model.PageData)
                    {
                            <tr>
                                <td hidden>@item.Pt_Id</td>
                                <td>@item.Acceptance_TicketNumber</td><!--受理单号2-->
                                <td>@item.Pt_CertificateNumber</td><!--完税证号3-->
                                <td>@item.In_Number</td><!--发票号4-->
                                @if(@item.Hs_attribute != null)
                                {
                                  <td>@item.Hs_attribute</td><!--房屋属相5-->
                                }
                                 else
                                { 
                                    <td>无</td>
                                }                          
                                <td>@(item.Lease_Rent*0.01)</td><!--房屋租金6-->
                                <td>@item.Hs_Proportion</td><!--房屋面积7-->
                                <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxStartTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td><!--税起日期8-->
                                <td>@TimeHelper.TimeStampToDateTime(item.Acceptance_TaxEndTime.ToString(), TimeHelper.ToTimeType.link_ymd)</td><!--税止日期9-->
                                <td>@TimeHelper.TimeStampToDateTime(item.Pt_Date.ToString(), TimeHelper.ToTimeType.link_ymd)</td><!--纳税时间10-->
                                <td>@(item.Pt_ActualTax*0.01)</td><!--实际纳税金额11-->
                                <td>@item.Pt_State</td><!--纳税状态-->
                                <td>@item.address</td><!--房屋地址-->
                            </tr>
                    }
                    </tbody>
                </table>
                <div class="row">
                    <div class="col-sm-9">
                        @Html.Pager(Model.PageData, new PagerOptions { PageIndexParameterName = "index", ContainerTagName = "ul", PrevPageText = "上页", NextPageText = "下页", FirstPageText = "首页", LastPageText = "尾页", CssClass = "pagination", PagerItemsSeperator = "", CurrentPagerItemWrapperFormatString = "<li class=\"active\"><a href=\"#\">{0}</a></li>", PagerItemWrapperFormatString = "<li>{0}</li>" }, new { id = "", @class = "pagination" })
                    </div>
                    <div class="col-sm-3">
                        共 @Model.PageData.TotalItemCount 条记录，页 @Model.PageData.CurrentPageIndex/@Model.PageData.TotalPageCount
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 导出模态 -->
    <form action="/Browse/AHouseholdTaxMeg" enctype="multipart/form-data" method="post" id="formDownload">
        <div id="exportHtml" style="display:none;">
            <div class="eh_wrap">
                <div class="eh_head">
                    <p style="">请选择您要导出的数据列</p>
                </div>
                <table width="100%" cellpadding="5" cellspacing="0" style="text-align:center;">
                    <tr>
                        <td><input id="Acceptance_TicketNumber" type="checkbox" value="受理单号" name="chk_list" checked="checked" /><label>受理单号</label></td>
                        <td><input id="Pt_CertificateNumber" type="checkbox" value="完税证号" name="chk_list" checked="checked" /><label>完税证号</label></td>
                        <td><input id="In_Number" type="checkbox" value="发票号" name="chk_list" checked="checked" /><label>发票号</label></td>
                    </tr>
                    <tr>
                        <td><input id="Hs_attribute" type="checkbox" value="房屋属性" name="chk_list" checked="checked" /><label>房屋属性</label></td>
                        <td><input id="Lease_Rent" type="checkbox" value="房屋租金" name="chk_list" checked="checked" /><label>房屋租金</label></td>
                        <td><input id="Hs_Proportion" type="checkbox" value="房屋面积" name="chk_list" checked="checked" /><label>房屋面积</label></td>
                    </tr>
                    <tr>
                        <td><input id="Acceptance_TaxStartTime" type="checkbox" value="征收起日" name="chk_list" checked="checked" /><label>征收起日</label></td>
                        <td><input id="Acceptance_TaxEndTime" type="checkbox" value="征收止日" name="chk_list" checked="checked" /><label>征收止日</label></td>
                        <td><input id="Pt_Date" type="checkbox" value="纳税时间" name="chk_list" checked="checked" /><label>纳税时间</label></td>
                    </tr>
                    <tr>
                        <td><input id="Pt_ActualTax" type="checkbox" value="纳税额" name="chk_list" checked="checked" /><label>纳税额</label></td>
                        <td><input id="Pt_State" type="checkbox" value="状态" name="chk_list" checked="checked" /><label>状态</label></td>
                        <td><input id="address" type="checkbox" value="房屋地址" name="chk_list" checked="checked" /><label>房屋地址</label></td>
                    </tr>
                </table>
                <div class="box-footer">
                    <button type="submit" id="btnExportSure" class="layui-btn layui-btn-springgreen layui-btn-small pull-right" style=" margin-right:30px;">
                        <i class="fa fa-repeat"></i>导出
                    </button>
                    <input type="hidden" id="AHouseholdTaxMeg" name="AHouseholdTaxMeg" value="" />
                    <input type="hidden" id="whereExport" name="whereExport" value="" />
                </div>
            </div>
        </div>
    </form>
</body>
</html>
<script>
    ////导出隐藏域赋值
    //function getWhere() {
    //    var inputStr = $("#input").val();      
    //    document.getElementById("whereExport").value = inputStr;
    //    alert(document.getElementById("whereExport").value);
    //}
    /*导出*/
    $("#btnExport").click(function () {   
        layer.open({
            type: 1,
            title: '导出提示',
            shade: false,
            skin: 'layui-layer-rim',
            area: ['620px', '280px'], //宽高
            content: $('#exportHtml')
        });    
    });
    /*导出交互*/
    $("#btnExportSure").click(function () {
        var arr = new Array();
        $("[name='chk_list']").each(function () {
            if ($(this).is(":checked")) {
                arr.push($(this).attr("id") + "|" + $(this).val());
            }
        });
        $("#AHouseholdTaxMeg").val(arr);
        document.getElementById('formDownload').submit();
        layer.closeAll();
    });
</script>